package com.swt.draw.service.impl;

import com.swt.draw.dao.PostMapper;
import com.swt.draw.entity.Post;
import com.swt.draw.example.PostExample;
import com.swt.draw.service.PostService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @ClassName
 * @Description TODO
 * @Author Administrator
 * @Date 2019/8/29 0029 23:02
 * @Version 1.0
 **/
@Service("postService")
public class PostServiceImpl implements PostService {
    @Resource
    private PostMapper postMapper;

    @Override
    public List<Post> getAllPosts() {
        PostExample example = new PostExample();
        PostExample.Criteria criteria = example.createCriteria();
        criteria.andPostStatusEqualTo((short) 0);
        List<Post> posts = postMapper.selectByExample(example);
        return posts;
    }
}
